import React from 'react'
// 引入store
import store from '../redux/store'
// 引入actionCreator
import { setM } from '../redux/actions'
// 引入自定义hook
import useRedux from '../hooks'
export default function Ls() {
  console.log('ls更新了')
  useRedux()
  return (
    <div>
      <input
        type="text"
        onKeyUp={(e) => {
          if (e.keyCode === 13) {
            store.dispatch(setM(e.target.value))
          }
        }}
      />
      <p>{store.getState().ls.msg}</p>
    </div>
  )
}
